package com.sduept.nwld.dataserver.model.rota;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.PrePersist;
import javax.persistence.PreUpdate;
import javax.persistence.Table;

import com.sduept.generator.ObjectId;
/**
 *
 *轮值列表
 */
@Entity
@Table(name="t_rota_order")
public class RotaOrder implements Serializable,Cloneable{
	
	/**
	 * 
	 */
	private static final long serialVersionUID = -4666052568722941041L;

	@Id
	@Column(length=50)
	private String id;	
	
	@PrePersist
	public void init(){
		if(id == null || id.trim().length() == 0){
			id = ObjectId.get().toString();
		}
	}
	
	@PreUpdate
	public void preUpdate(){
		if(id == null || id.trim().length() == 0){
			id = ObjectId.get().toString();
		}
	}
	/**
	 * 值班人员名称
	 */
	private String personName;
	/**
	 * 值班人员ID
	 */
	private String personId;
	/**
	 * 轮值顺序
	 */
	private int rotaOrder;
	
	/**
	 * 重要备注
	 */
	private String remark;
	/**
	 * 当值游标
	 * 1 当值; 0不当值日
	 */
	private int rotaCursor;
	public String getId() {
		return id;
	}
	public void setId(String id) {
		this.id = id;
	}
	
	public String getPersonName() {
		return personName;
	}

	public void setPersonName(String personName) {
		this.personName = personName;
	}

	public String getPersonId() {
		return personId;
	}

	public void setPersonId(String personId) {
		this.personId = personId;
	}
	public int getRotaOrder() {
		return rotaOrder;
	}

	public void setRotaOrder(int rotaOrder) {
		this.rotaOrder = rotaOrder;
	}

	public String getRemark() {
		return remark;
	}
	public void setRemark(String remark) {
		this.remark = remark;
	}
	public int getRotaCursor() {
		return rotaCursor;
	}
	public void setRotaCursor(int rotaCursor) {
		this.rotaCursor = rotaCursor;
	}
	
	public String toString(){
		return personId+"-"+personName;
	}

	
	
	
	
}
